/*global $, CollectReqInfo*/
$(document).ready(function () {
    $('#adTonglan').remove();
    $('#top, div.maincenter, #bottom').css('margin-left', '500px');

    var $tr1 = $('.grayline .jobs_1 tr:nth-child(1)');

    var reqInfo = {
        jobboard: '前程无忧',
        entity: $('a[href="#gsjj"]').prev().text().trim(),
        title: $('.sr_bt').text().trim(),
        headcount: $(':nth-child(6)', $tr1).text().trim(),
        location: $(':nth-child(4)', $tr1).text().trim().split('-')[0],
        JD: $('.txt_4.job_detail').html().replace(/\r\n|\n/g, '')
                                         .replace('<strong>职位描述:</strong>', '')
                                         .replace(/<\/div>\s*<div[^>]*>/gi, '\n')
                                         .replace(/<div[^>]*>/gi, '\n')
                                         .replace(/<\/p>\s*<p[^>]*>/gi, '\n')
                                         .replace(/<p[^>]*>/gi, '\n')
                                         .replace(/<\/ol>/gi, '\n\n')
                                         .replace(/<\/li[^>]*>\s*<li>/gi, '\n0.')
                                         .replace(/<li[^>]*>/gi, '\n0.')
                                         .replace(/<br[^>]*>/gi, '\n')
                                         .replace(/<\/?[^>]+>/gi, '')
                                         .replace(/&nbsp;/g, '')
    };

    CollectReqInfo.init($('body'), reqInfo);
});
